package org.zhengquan.dao;

import org.apache.ibatis.annotations.Param;
import org.zhengquan.pojo.SysRoleAcl;

import java.util.List;

public interface SysRoleAclMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysRoleAcl record);

    int insertSelective(SysRoleAcl record);

    SysRoleAcl selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysRoleAcl record);

    int updateByPrimaryKey(SysRoleAcl record);

    /**
     * 根据角色id查询权限点
     *
     * @param roleIdList
     * @return
     */
    List<Integer> selectAclIdListByRoleIdList(@Param("roleIdList") List<Integer> roleIdList);

    /**
     * 根据roleid删除acl
     * @param roleId
     */
    void deleteByRoleId(@Param("roleId") Integer roleId);

    /**
     * 批量插入角色和权限点的关系
     * @param roleAclList
     */
    void batchInsert(@Param("roleAclList") List<SysRoleAcl> roleAclList);

    /**
     * 根据aclId查询分配给哪些角色
     * @param aclId
     * @return
     */
    List<Integer> selectRoleIdListByAclId(@Param("aclId") Integer aclId);
}